package org.tigr.microarray.mev.file;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import org.tigr.microarray.mev.RNASeqChipAnnotation;
import org.tigr.microarray.mev.annotation.IChipAnnotation;

public abstract class ExpressionFileLoader {

    protected SuperExpressionFileLoader superLoader;
    protected boolean stop = false;
    protected IChipAnnotation chipAnno = new RNASeqChipAnnotation();
    protected int firstRow = -1;
    protected int firstCol = -1;

    public ExpressionFileLoader(SuperExpressionFileLoader superLoader) {
//		super(superLoader.getFrame());
        this.superLoader = superLoader;
    }

    /**
     * Returns number of lines in the specified file.
     */
    protected int getCountOfLines(File file) throws IOException {
        int count = 0;
        BufferedReader reader = new BufferedReader(new FileReader(file));
        String currentLine;
        while ((currentLine = reader.readLine()) != null) {
            count++;
        }
        reader.close();
        return count;
    }
    
    
}
